﻿using Swashbuckle.AspNetCore.Annotations;
using Volo.Abp.Application.Dtos;

namespace Xms.Abp.Application.Dtos;

public class PagedAndSortedParameter : PagedAndSortedResultRequestDto, IPagedAndSortedParameter
{
    [SwaggerSchema("分页号，与SkipCount二选一")]
    public int PageIndex
    {
        get => SkipCount / MaxResultCount + 1;
        set => SkipCount = (value - 1) * MaxResultCount;
    }
    [SwaggerSchema("分页大小，与MaxResultCount二选一")]
    public int PageSize
    {
        get => MaxResultCount;
        set => MaxResultCount = value;
    }

    [SwaggerSchema("跳过数量，与PageIndex二选一")]
    public override int SkipCount { get; set; } = 0;

    [SwaggerSchema("每页最大数量，与PageSize二选一")]
    public override int MaxResultCount { get; set; } = 15;
}
